<?php
require_once ('library/config.inc.php');
require_once ('library/global.func.php');
$log_array = array ();
$module = check($_GET['module']);
$uin = check($_GET['uin']);
$sessionKey = check($_GET['sessionKey']);
if (($module == "recharge_type" || $module == "index") && $uin > 0) {
	require_once (CONN_PATH);
	require_once ('library/core.class.php');
	$core = new core($conn);
	if ($sessionKey == '' && checkLogin()) {
		if ($log_array['uin'] == $uin) {
			header("Location:{$module}.php");
		}
	}
	elseif ($uin > 0 && $sessionKey != "") {
		$log_array = $core->session_login($uin, $sessionKey);
		unset ($core);
		if ($log_array['chk_uin'] == $uin) {
			$_SESSION['account_arr'] = $log_array;
			header("Location:{$module}.php");
		} else {
			header("Location:./");
		}
		require_once ('close.inc.php');
	} else {
		header("Location:./");
	}
	exit ();
}
?>